/**
 * @details: 
 * @brief: 
 * @version: 1.0
 * @author: liuri
 * @Date: 2021-10-05 05:01:00
 * @LastEditors: liuri
 * @LastEditTime: 2021-10-05 05:01:00
 * @FilePath: /TestProject/cPath/vtysh/cmd_token.h
 * @Copyright (C) 2021 liuri. All rights reserved.
 */




#ifndef __CMD_TOKEN_H__
#define __CMD_TOKEN_H__

#include "vector.h"
#include "cmd_terminal_type.h"

// cmd_token 类型 
enum cmd_token_type
{
    TOKEN_TERMINAL = 0,
    TOKEN_MULTIPLE,
    TOKEN_KEYWORD,
};






struct cmd_token
{
    enum cmd_token_type type;
    enum cmd_terminal_type terminal;

    /* Used for type == MULTIPLE */
    vector multiple; /* vector of cmd_token, type == FINAL */

    /* Used for type == KEYWORD */
    vector keyword; /* vector of vector of cmd_tokens */

    /* Used for type == TERMINAL */
    char *cmd;                    /* Command string. */
    char *desc;                   /* Command's description. */
};


vector cmd_parse_format(const char *string, const char *descstr);

#endif
